package com.heima.media.listener;

import com.heima.media.task.ArticleTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class ArticleDelayListener {
    @Autowired
    private ArticleTask articleTask;
    @PostConstruct//初始化的时候就会执行这个方法
    public void handleMessage(){
        try {
            articleTask.receiveMesasge();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
